package cn.ljy.mes.model;

import cn.ljy.authority.model.SysUser;
import cn.ljy.common.model.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 生产步骤审核日志实体类
 * 对应表：mes_production_order_step_audit_log
 */
@ApiModel(value = "生产步骤审核日志")
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false, of = {"id"})
public class MesProductionOrderStepAuditLog extends BaseModel {

    @ApiModelProperty(value = "步骤记录ID", example = "01f15383-7cb4-11f0-92a2-0250f2000002")
    private String id;

    @ApiModelProperty(value = "生产工单步骤")
    private MesProductionOrderStep productionOrderStep;

    @ApiModelProperty(value = "生产工单")
    private MesProductionOrder productionOrder;

    @ApiModelProperty(value = "生产工单ID", notes = "仅用于数据库检索（虽然有关联字段productionOrder，但是关联字段需要连表查询，故针对检索频率高的字段加上这个），不作为查询条件、插入、更新、删除的依据字段")
    private String productionOrderId;

    @ApiModelProperty(value = "工艺明细")
    private MesCarTechnologyDetail technologyDetail;

    @ApiModelProperty(value = "工艺详情ID", notes = "仅用于数据库检索（虽然有关联字段technologyDetail，但是关联字段需要连表查询，故针对检索频率高的字段加上这个），不作为查询条件、插入、更新、删除的依据字段")
    private String technologyDetailId;

    @ApiModelProperty(value = "物料批次")
    private WmsMaterialBatch materialBatch;

    @ApiModelProperty(value = "物料批次ID", notes = "仅用于数据库检索（虽然有关联字段materialBatch，但是关联字段需要连表查询，故针对检索频率高的字段加上这个），不作为查询条件、插入、更新、删除的依据字段")
    private String materialBatchId;

    @ApiModelProperty(value = "实际用量",example = "95")
    private Long actualQuantity;

    @ApiModelProperty(value = "操作员")
    private SysUser operator;
    @ApiModelProperty(value = "操作员ID", notes = "仅用于数据库检索（虽然有关联字段operator，但是关联字段需要连表查询，故针对检索频率高的字段加上这个），不作为查询条件、插入、更新、删除的依据字段")
    private String operatorId;

    @ApiModelProperty(value = "开始时间",example = "2025-08-18 12:28:26")
    private Date startTime;

    @ApiModelProperty(value = "完成时间", example = "2025-08-19 12:29:32")
    private Date endTime;

    @ApiModelProperty(value = "审核员")
    private SysUser auditor;

    @ApiModelProperty(value = "审核时间", example = "2025-08-19 12:30:00")
    private Date auditTime;

    @ApiModelProperty(value = "审核结果",  example = "true",
            notes = "true:审核通过, false:审核失败")
    private Boolean auditResult;

    @ApiModelProperty(value = "审核意见", example = "用料符合标准")
    private String auditNote;

    @ApiModelProperty(value = "创建时间",example = "2025-08-19 12:29:32")
    private Date createTime;

    //非数据库字段
    @ApiModelProperty(value = "品牌名",notes = "用于显示查询结果字段")
    private String brandName;
    @ApiModelProperty(value = "车型名",notes = "用于显示查询结果字段")
    private String modelName;
    @ApiModelProperty(value = "配置名",notes = "用于显示查询结果字段")
    private String modelConfigName;
    @ApiModelProperty(value = "物料名",notes = "用于显示查询结果字段")
    private String materialName;
    @ApiModelProperty(value = "物料批次号",notes = "用于显示查询结果字段")
    private String batchNumber;
    @ApiModelProperty(value = "订单号",notes = "用于显示查询结果字段")
    private String orderNo;
    @ApiModelProperty(value = "车辆VIN",notes = "用于显示查询结果字段")
    private String vin;
    @ApiModelProperty(value = "步骤序号",notes = "用于显示查询结果字段")
    private String stepSort;
    @ApiModelProperty(value = "计划数量",notes = "用于显示查询结果字段")
    private Long planQuantity;
    @ApiModelProperty(value = "操作者名字",notes = "用于显示查询结果字段")
    private String operatorName;
    @ApiModelProperty(value = "审核者名字",notes = "用于显示查询结果字段")
    private String auditorName;

    public MesProductionOrderStepAuditLog(String id) {
        this.id = id;
    }
}